package com.bankcomm.ui.adapter;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bankcomm.R;
import com.bankcomm.bean.NodeInfo;

/**
 * 网点列表Adapter
 * 
 * @author zhang.h
 * 
 * @date 2012-6-14 下午01:42:30
 */
public class NodeInfoAdapter extends MainBaseAdapter<NodeInfo> {

	public NodeInfoAdapter(Activity context) {
		super(context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;

		View itemView = convertView;
		if (itemView == null) {
			itemView = mContext.getLayoutInflater().inflate(R.layout.node_info_item, null);

			holder = new ViewHolder();
			holder.nodeName = (TextView) itemView.findViewById(R.id.nodeName);
			holder.nodeAddr = (TextView) itemView.findViewById(R.id.nodeAddr);
			holder.nodePhone = (TextView) itemView.findViewById(R.id.nodePhone);

			itemView.setTag(holder);
		} else {
			holder = (ViewHolder) itemView.getTag();
		}

		// 网点名称
		holder.nodeName.setText(mList.get(position).getMarkName());
		// 网点地址
		holder.nodeAddr.setText(mList.get(position).getMarkAddr());
		// 网点电话
		holder.nodePhone.setText(mList.get(position).getMarkPhone());
		
		return itemView;
	}

	static class ViewHolder {
		TextView nodeName;
		TextView nodeAddr;
		TextView nodePhone;
	}

}
